package com.zx.system.block.dao;

import com.zx.system.block.model.SysPost;
import com.zx.system.block.model.SysUserPost;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysUserPostMapper {
    int deleteByPrimaryKey(@Param("userId") String userId, @Param("postId") String postId);

    int insert(SysUserPost row);

    int insertSelective(SysUserPost row);

    List<SysUserPost> selectUserPostByPostId(@Param("postId") String postId);

    List<SysUserPost> selectUserPostByUserId(@Param("userId") String userId);

    /**
     * 根据用户ID获取岗位列表
     *
     * @param userId 用户ID
     * @return 岗位列表
     */
    List<SysPost> selectPostListByUserId(@Param("userId") String userId);

    void batchInsert(@Param("list") List<SysUserPost> list);

    void batchDeleteByUserAndPostIds(@Param("userId") String userId, @Param("list") List<String> list);

    void deleteByUserId(@Param("userId") String userId);
}